import { pixelPartyModule } from "../module";
import { PixelPartyMainState } from "./mainState";

export class PixelPartyCountDownState extends pixelPartyModule.State {
    override onEnter(): void {
        this.runner.run(async (r) => {
            this.context.players.title("即将开始游戏");
            for (let i = 5; i > 0; i--) {
                await r.wait(20);
                this.context.players.title(i.toString());
            }
            await r.wait(20);
            this.transitionTo(PixelPartyMainState);
        });
    }
}
